function getContentHeight() {
  // 页面高度
  let viewHeight =
    window.innerHeight ||
    document.body.clientHeight ||
    document.documentElement.clientHeight;
  // 头部高度
  let headerHeight = document.getElementById("header").offsetHeight;
  // 尾部高度
  let footerHeight = document.getElementById("footer").offsetHeight;
  // 高度
  let Height = viewHeight - headerHeight - footerHeight;
  let contentBoxEle = document.querySelector(".contentBox");
  if (!contentBoxEle) return;
  // 最小高度
  let MinHeight = contentBoxEle.offsetHeight + 50;
  // 最终高度
  let resHeight = Height > MinHeight ? Height : MinHeight;
  // 主体元素
  let contentEle = document.querySelector(".contentHeight");
  contentEle.style.minHeight = resHeight + "px";
}

export default function contentHeight() {
  getContentHeight();
  window.addEventListener("resize", getContentHeight);
}
